/**
 * 获取选中行-导出
 * @param {*} ref
 * @param {*} key
 * @returns
 */
export const getTableSelectRow = (ref, key = "id") => {
  let records = ref?.$table?.getCheckboxRecords()||[];
  let arr = records?.map((item) => item[key]);
  if (arr.length) {
    return { [key]: arr };
  } else {
    return ref.getQueryForm()
  }
};
export const handleLink = (_link) => {
  if (!_link) return;
  window.open(_link, "noopener", "noreferrer");
};
